/**
 * \file mallocD.c
 */
/*
#include "kernel.h"
#include <string.h>
#include <stdlib.h>
#include "malloc.h"

volatile void *NULLPTR=NULL;
volatile unsigned int ZERO=0;

//	BEGIN EVENT
EVENT *event_alloc(void){
	volatile EVENT *ret;
	ret=malloc(sizeof(EVENT));
	memset((void*)ret,0,sizeof(EVENT));
	ret->queue=queue_alloc();
	return (EVENT*)ret;
}

void event_free(EVENT *o){
	queue_free(o->queue);
	free(o);
}
//	END EVENT


// BEGIN QUEUE
QUEUE_ITEM *queue_item_alloc(){	
	volatile QUEUE_ITEM *ret;
	ret=malloc(sizeof(QUEUE_ITEM));
	memset((void*)ret,0,sizeof(QUEUE_ITEM));
	return (QUEUE_ITEM*)ret;
}
void queue_item_free(QUEUE_ITEM *o){
	free(o);
}

QUEUE *queue_alloc(){
	volatile QUEUE *ret;
	ret=malloc(sizeof(QUEUE));
	memset((void*)ret,0,sizeof(QUEUE));
	return (QUEUE*)ret;
}

//TODO:IMPLEMENT
void queue_free(QUEUE *o){
	volatile QUEUE_ITEM *t1, *t2;
	t1=o->next;
	while(t1!=NULL){
		t2=t1->next;
		queue_item_free((QUEUE_ITEM*)t1);
		t1=t2;
	}
	free(o);
}
// END QUEUE

//TODO:IMPLEMENT
TASK_CONSTRUCTOR *TC_alloc(){
	volatile TASK_CONSTRUCTOR *ret;
	ret=malloc(sizeof(TASK_CONSTRUCTOR));
	memset((void*)ret,0,sizeof(TASK_CONSTRUCTOR));
	return (TASK_CONSTRUCTOR*)ret;
}

//TODO:IMPLEMENT
void TC_free(TASK_CONSTRUCTOR *o){
	free(o);
}

//TODO:IMPLEMENT
TASK_DESCRIPTOR *TD_alloc(){
	volatile TASK_DESCRIPTOR *ret;
	ret=malloc(sizeof(TASK_DESCRIPTOR));
	memset((void*)ret,0,sizeof(TASK_DESCRIPTOR));
	return (TASK_DESCRIPTOR*)ret;
}

//TODO:IMPLEMENT
void TD_free(TASK_DESCRIPTOR *o){
	free(o);
}

//TODO:IMPLEMENT
TASK_EXECUTER *TE_alloc(){
	volatile TASK_EXECUTER *ret;
	ret=malloc(sizeof(TASK_EXECUTER));
	memset((void*)ret,0,sizeof(TASK_EXECUTER));
	return (TASK_EXECUTER*)ret;
}

//TODO:IMPLEMENT
void TE_free(TASK_EXECUTER *o){
	free(o);
}
*/
